Assorted MsDos Tricks Tue 31-May-94 ===================== All rights reserved Copyright (c) 1994 by Timo Salmi .................................................................. Prof. Timo Salmi Co-moderator of comp.archives.msdos.announce Moderating at garbo.uwasa.fi anonymous FTP archives 128.214.87.1 Faculty of Accounting & Industrial Management; University of Vaasa Internet: ts@uwasa.fi BBS +(358)-61-3170972; FIN-65101, Finland .................................................................. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ This file belongs to TSBAT*.ZIP. Please do not distribute ³ ³ this dostrick.txt file separately! ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ You are free to quote brief passages from this file provided you clearly indicate the source with a proper acknowledgment. Comments and corrections are solicited. But if you wish to have individual MsDos usage consultation, please rather post your question to a UseNet newsgroup like comp.os.msdos.misc. It is much more efficient than asking me by email. I'd like to help, but I am very pressed for time. I prefer to pick the questions I answer from the Usenet news. Thus I can answer publicly at one go if I happen to have an answer. Besides, newsgroups have a number of readers who might know a better or an alternative answer. Don't be discouraged, though, if you get a reply like this from me. I am always glad to hear from fellow MsDos users. INDEX ===== 1) Disabling MsDos commands 2) Simulating disk partitioning 3) A config.sys and autoexec.bat example 1. Disabling MsDos commands =========================== You may wish to disable certain MsDos commands for security reasons to prevent them from being used either accidentally or deliberately. If you have a command line editor, like doskey, then the disabling is rather straigtforward. All you have to do is to create a macro with the same name as the MsDos command. Consider the following examples. The first example disables the internal MsDos date command so that the date on your system cannot be changed. doskey date=rem date has been disabled The second example disables the format command. doskey format=rem format has been disabled Note that since format is an external command, that is it is a program on your disk, not a command in your command.com command interpreter, you can still invoke it by giving the explicit path to it like c:\dos\format In fact, since it will be at path, a drive letter will suffice. Of course it is very easy to ged rid of these redefinitions. In using doskey, you only have to press alt+F10 to clear the macros. If you use some other command line editor than doskey then the commands are naturally slightly different. For example were you to use CED (garbo.uwasa.fi:/pc/cmdutil/ced10da.zip) the commands would be ced syn date echo date has been disabled Restoring the date command would be ced clear syn date 2. Simulating disk partitioning =============================== Since I have more than one PC at my disposal, I have noticed that it is very useful to have some common standard on them including similar disk names. For example I always assume that R: is my ramdisk. Also I usually have my hard disk partitioned so that I have a pairly fixed usage for C: D: E: and F:. One of the PCs is an ICL laptop, with a 120Mb disk all on C: with no partitioning. below is what I have in my autoexec.bat to have the ram disk reference the way I want and to simulate the disk partitioning. Note the importance of the order of the substitute commands because of the double usage of D, since that is where the ram disk _originally_ resides on my ICL configuration. c:\dos\subst r: d:\ c:\dos\subst d: c:\d c:\dos\subst e: c:\e c:\dos\subst f: c:\f 3. A config.sys and autoexec.bat example ======================================== There always is something to learn from looking at the other users' config.sys and autoexec.bat files. Here are mine from my office 486 with MsDos 5.0. I have added some comments for you. DEVICE=C:\DOS\SETVER.EXE DEVICE=C:\DOS\HIMEM.SYS DOS=UMB device=c:\dos\emm386.exe /noems /i=e000-efff /x=d200-d600 dos=high COUNTRY=032,,C:\DOS\COUNTRY.SYS FILES=30 devicehigh=c:\dos\ramdrive.sys 7000 128 256 /e rem ZANSI.SYS is from garbo.uwasa.fi:/pc/screen/zansi12.zip devicehigh=c:\sys\zansi.sys rem Define a bigger environment size shell=c:\command.com /p /e:1024 lastdrive=z @ECHO OFF rem Description: My normal MsDos 5.0 boot with Scrollit rem Note below the trick to identify which of my PCs I am using: set pcid_=karvi rem Yellow text on black background echo [40;33;1m PATH C:\DOS;c:\tools;e:\arczip rem DAILY.EXE is from /pc/ts/tsbat45.bat to run a mini-backup rem call c:\bat\daily c:\tools\pkzip -u d:\root\root c:\*.* PROMPT $p$g rem CHKSUM is from /pc/goldies/chksum16.zip c:\tools\chksum command.com 49024 io.sys 9850 msdos.sys 5750 loadhigh c:\dos\KEYB SU,,C:\DOS\KEYBOARD.SYS rem The Command line EDitor is from /pc/goldies/ced.zip loadhigh c:\tools\ced -B384,128,768,128,128 -Fced.cfg rem The TSR memory management until is from /pc/memutil/tsrcom35.zip c:\tools\mark scrollit rem The screen scrollback buffer is from /pc/screen/scrlit18.zip loadhigh c:\tools\scrollit /n=myname /k=myid 60 rem The Snipper screen capture is from /pc/goldies/snippr24.zip loadhigh c:\tools\snipper rem The cut and paste utility is from /pc/pcmag/vol11n07.zip loadhigh c:\tools\dosclip2 rem The CapsLock fix is from /pc/ts/tstsr19.zip loadhigh c:\tuki\shftcaps c:\dos\subst r: j:\ mkdir r:\cmand copy c:\command.com r:\cmand c:\dos\attrib +r r:\cmand\command.com set comspec=r:\cmand\command.com set temp=r:\cmand c:\dos\mode con: rate=32 delay=1 rem The clock comparison check is from /pc/ts/tsutil39.zip c:\tools\dtetimal 1994 r: